
<%--
 *  File:    AttchmentSummary.jsp
 *  @Author: Kolleryao
 *  Date:    12/06/2002
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>



<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%

  String strTableName = "ovattachmentsummary";
  String strModuleName = "BIEE";
//  String privilegeCode = "";
%>



<%
  	HashMap userInfo = (HashMap)session.getAttribute("userinfo");
    //String attachmentid =(String)session.getAttribute("attachmentid");
%>

<% //--------------------------------------  include files list --%>
<%--%@ include file="/inc/Security.inc" %--%>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>AccountsAccEdit</title>

<%
    Integer  forumid =(Integer) session.getAttribute("forumid");
    System.out.println("forumid = " + forumid);
    if(forumid==null)
    {

       String forumid1=request.getParameter("forumid");
        System.out.println("forumid1 = " + forumid1);
       forumid=new Integer(forumid1);
    }


%>
<PageFlow:CheckPageFlow pageName="p_attchmentsummary"/>
<%@ include file="/inc/SummaryDivision.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>

<%

Vector attachmentsummary = (Vector)pageContext.getAttribute("attachmentsummary");
	if(attachmentsummary == null)
  	{
    	attachmentsummary = new Vector();
  	}
// String  forumid = request.getParameter("forumid");
%>

</head>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  editform.action = "AttchmentSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function setid(i,type)
{cform.attachmentid.value=i;
cform.relatedentitytype.value=type;
}

function editpage()
{
	if(cform.attachmentid.value=="")
	{alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
      return;}
<%--[SCRIPT]  alert(cform.relatedentitytype.value);  [SCRIPT]--%>
     location.href ="AttchmentEdit.jsp?<%= OvalTools.randomURL() %>&attachmentid="+cform.attachmentid.value+"&relatedentitytype="+cform.relatedentitytype.value;
}

function deleteit()
{
	if (cform.attachmentid.value=="")
	{
      alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
      return;}
	  	var flag = confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>");
	if(!flag)
	  return;
	cform.actionname.value = "delete";
  	cform.target = "_self";
  	isRunning = true;
  	cform.submit();

}
function newpage()
{
<%--         alert("<%=JspHelper.filterNull( forumid)%>");--%>
        location.href="AttchmentNew.jsp?<%= OvalTools.randomURL() %>&forumid="+"<%=JspHelper.filterNull( forumid)%>"
}

</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
	<table width="100%" cellspacing="0">
		<tr>
<%--	    <td class="td-blue" width="74%"><img src="../images/<%= strLanguageCode %>/hand.gif" width="15" height="12">--%>
<%--	    <%= label.getLabelName("L_CurrentLocation") + label.getLabelName("L_Colon") + label.getLabelName("L_accessory")%>--%>
<%--	   	</td>--%>
	   	<td width="26%" class="td-blue-right">
	   		<table cellspacing="0" cellpadding="0" border="0" >
	     		<tr>
	       		<%--td class="td_center" width="25"><a href="javascript:showleft()"><img src="../images/<%= strLanguageCode %>/left_right.gif" width="12" height="11" border="0"></a></td--%>
	      	</tr>
	   		</table>
	  	</td>
	  </tr>
	</table>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<form name="cform" method="post" action="../Dispatcher">
		  <input type="hidden" name="actionname">
		  <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
		  <input type="hidden" name="pagename" value="p_attchmentsummary">
          <custom:hidden property="forumid"/>
			<tr>
			<td>
			<table width="100%" cellspacing="0" border="0" cellpadding="0" bgcolor="#FFFFFF">
			<tr>
				<td>
				<table width="100%" border="0" cellspacing="0">
				 	<tr>
       					<td class="summary_top" colspan="2" ></td>
		 			</tr>
						<%@ include file="/inc/SummarySearch.inc" %>
   				</table>
			 	</td>
			</tr>




			<tr>
				<td>
			   <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
			      <tr class="deepblue-left">
				      <td class="title_center" width="23">&nbsp;</td>
				       <td class="title_center" width="230"><a href="javascript:page_summary('orderby','attachmentname')"><%= label.getLabelName("L_Attachmentname") %></a></td>
				       <td class="title_center" width="230"><a href="javascript:page_summary('orderby','filename')"><%= label.getLabelName("L_filename") %></a></td>

				     <td class="title_center" width="90"><a href="javascript:page_summary('orderby','filesize')"><%= label.getLabelName("L_filesize") %></a></td>
				     <td class="title_center" width="80"><a href="javascript:page_summary('orderby','filetype')"><%= label.getLabelName("L_filetype") %></a></td>
						<td class="title_center"><a href="javascript:page_summary('orderby','comments')"><%= label.getLabelName(" L_description") %></a></td>
			</tr>
  	<%
            	int i = 0;
             	String strClassType = new String();
               	Integer nDefaultattachmentid = new Integer(-1);
				Integer nDefaulttype = new Integer(-1);
				boolean bHasChecked = false;
          	%>
			<logic:iterate id="sum" collection="<%= attachmentsummary %>">
           	<%

            	HashMap attachMap = (HashMap)pageContext.getAttribute("sum");
            	if(i%2 == 1)
            	{
              		strClassType = "td-listrom";
            	}else{
              		strClassType = "";
            	}
            String strIsDisabled = new String("");
           	String strIsChecked = new String("");
				 if(!bHasChecked)
				{
				  strIsChecked = "Checked";
				  bHasChecked = true;
				  nDefaultattachmentid = (Integer)(attachMap.get("attachmentid"));
				  nDefaulttype=(Integer)(attachMap.get("relatedentitytype"));
				};

            	i++;
          	%>
          	<tr  onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" onClick="javascript:radiotrue('cbox<%=JspHelper.filterNull(i)%>'); setid('<%=JspHelper.filterNull( attachMap.get("attachmentid") )%>','<%=JspHelper.filterNull( attachMap.get("relatedentitytype") )%>')" class="<%=JspHelper.filterNull( strClassType )%>">

			    <td>
			     <input id="cbox<%=JspHelper.filterNull(i)%>" type="radio" name="checkbox" <%=JspHelper.filterNull( strIsDisabled )%> value="<%=JspHelper.filterNull( attachMap.get("attachmentid") )%>" class="checkbox" <%=JspHelper.filterNull( strIsChecked)%>
				 onclick="setid('<%=JspHelper.filterNull( attachMap.get("attachmentid") )%>','<%=JspHelper.filterNull( attachMap.get("relatedentitytype") )%>')" >
			   </td>
			    <td>&nbsp;<custom:write name="sum" property="attachmentname"/></td>
          			    <td>&nbsp;<a href="../uploads/<custom:write name="sum" property="filename"/>" target="parent"><custom:write name="sum" property="filename"/></a></td>
			    <td>&nbsp;<custom:write name="sum" property="filesize"/>KB</td>
		     <td>&nbsp;<custom:write name="sum" property="filetype"/></td>
		      <td>&nbsp;<custom:write name="sum" property="comments"/></td>
			</tr>
		  </logic:iterate>
		  		  <input type="hidden" name="attachmentid" value="<%=JspHelper.filterNull(nDefaultattachmentid)%>">
				  <input type="hidden" name="relatedentitytype" value="<%=JspHelper.filterNull(nDefaulttype)%>">
		 	<%@ include file="/inc/SummaryAction.inc" %>
       </table>
	</td>
	</tr>
	</table>
        <tr>
          <td class="summary_top"></td>
        </tr>


      </table>
    </td>
  </tr>
</table>
<table width="100%">
	<tr>
		<td class="td_center">
     <a onclick="newpage()"><custom:button type="1" label="L_New" imgsrc="edit.gif" border="0" style="width:60"/></a> <a onclick="editpage()"><custom:button type="1" label="L_Edit" imgsrc="edit.gif" border="0" style="width:60"/></a> <a onclick="deleteit()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a></td>
    </tr>
</table>
</form>
</body>
</html>


